﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using WPFExcelReport.Helpers;
using System.Collections.Generic;
namespace WPFExcelReport
{

    /// <summary>
    /// 当前VVT和列表
    /// </summary>
    public partial class TVVTLIEF
    { 
        
        public TVVTLIEF()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VVVTLIEF();
            MESSAGES += "WB2KO;";
            this.DataContext = MV;
            InitializeComponent();
        }
        public override void OnVVTChg(string vvt)
        { 
            ORDERNUM = vvt;           
            base.OnVVTChg(vvt);
        }
        public override void LOADBYAUF()
        {
            TBMain.Clear();
            if (ORDERNUM.Length < 20)
                return; 
            PM["AUFTYP"] = ORDERNUM.Substring(0, 1);
            PM["KRS"] = ORDERNUM.Substring(1, 2);
            PM["LFD"] = ORDERNUM.Substring(3, 6);
            PM["POS"] = ORDERNUM.Substring(9, 3);
            PM["LIEFSCH"] = ORDERNUM.Substring(12, 8); 
            SResult = ((VVVTLIEF)MV).VVTLOAD(PM);
            MergeData(SResult, true);
            base.LOADBYAUF();
        }  
    }
}